<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
    <th:block th:include="include :: header('修改车辆登记')" />
    <th:block th:include="include :: datetimepicker-css" />
</head>
<body class="white-bg">
    <div class="wrapper wrapper-content animated fadeInRight ibox-content">
        <form class="form-horizontal m" id="form-fCar-edit" th:object="${fCar}">
            <input name="carId" th:field="*{carId}" type="hidden">
            <div class="form-group">
                <label class="col-sm-3 control-label is-required">车型：</label>
                <div class="col-sm-8">
                    <input name="carModel" th:field="*{carModel}" class="form-control" type="text" required>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label is-required">车牌号：</label>
                <div class="col-sm-8">
                    <input name="carNumber" th:field="*{carNumber}" class="form-control" type="text" required>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">车辆颜色：</label>
                <div class="col-sm-8">
                    <input name="carColour" th:field="*{carColour}" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">发动机号：</label>
                <div class="col-sm-8">
                    <input name="fadongji" th:field="*{fadongji}" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">车架号：</label>
                <div class="col-sm-8">
                    <input name="chejiahao" th:field="*{chejiahao}" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">车辆排量：</label>
                <div class="col-sm-8">
                    <input name="pailiang" th:field="*{pailiang}" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">购车时间：</label>
                <div class="col-sm-8">
                    <div class="input-group date">
                        <input name="purchaseTime" th:value="${#dates.format(fCar.purchaseTime, 'yyyy-MM-dd')}" class="form-control" placeholder="yyyy-MM-dd" type="text">
                        <span class="input-group-addon"><i class="fa fa-calendar"></i></span>
                    </div>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">购车费用：</label>
                <div class="col-sm-8">
                    <input name="purchasePrice" th:field="*{purchasePrice}" class="form-control" type="number">
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label">车辆来源：</label>
                <div class="col-sm-8">
                    <input name="laiyuan" th:field="*{laiyuan}" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">停放位置：</label>
                <div class="col-sm-8">
                    <input name="tingfangweizhi" th:field="*{tingfangweizhi}" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">驾驶员姓名：</label>
                <div class="col-sm-8">
                    <input name="jiashiyuan" th:field="*{jiashiyuan}" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">驾驶员身份证号：</label>
                <div class="col-sm-8">
                    <input name="jiashiyuanNumber" th:field="*{jiashiyuanNumber}" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">保管责任人：</label>
                <div class="col-sm-8">
                    <input name="zerenren" th:field="*{zerenren}" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">备注：</label>
                <div class="col-sm-8">
                    <textarea name="remark" class="form-control">[[*{remark}]]</textarea>
                </div>
            </div>
        </form>
    </div>
    <th:block th:include="include :: footer" />
    <th:block th:include="include :: datetimepicker-js" />
    <script th:inline="javascript">
        var prefix = ctx + "financial/fCar";
        $("#form-fCar-edit").validate({
            focusCleanup: true
        });

        function submitHandler() {
            if ($.validate.form()) {
                $.operate.save(prefix + "/edit", $('#form-fCar-edit').serialize());
            }
        }

        $("input[name='purchaseTime']").datetimepicker({
            format: "yyyy-mm-dd",
            minView: "month",
            autoclose: true
        });
    </script>
</body>
</html>